Skip to content

Detect orig.Invoke() and orig?.Invoke() for CL0003#1

Open
JaThePlayer wants to merge 1 commit into
EverestAPI:masterfrom
JaThePlayer:detect_orig_Invoke
Open

Detect orig.Invoke() and orig?.Invoke() for CL0003#1
JaThePlayer wants to merge 1 commit into
EverestAPI:masterfrom
JaThePlayer:detect_orig_Invoke

Conversation

@JaThePlayer

Copy link
Copy Markdown
Member

Previously, these two ways to invoke orig would trigger CL0003, warning about not calling orig on any codepath , even though it is called:

using var detour4 = new Hook(..., static (Action<int> orig, int arg) => {
  orig.Invoke(arg);
});
            
using var detour5 = new Hook(..., static (Action<int> orig, int arg) =>  {
  orig?.Invoke(arg);
});```

Comment on lines +165 to +167
{
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: why is the block necessary? why not:

Suggested change
{
return true;
}
return true;

Comment on lines +176 to +178
{
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick:

Suggested change
{
return true;
}
return true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants